<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'add.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	  <%@ include file="/common/import.jsp"%>
	 <%@ include file="/common/meta.jsp" %>
	 <style type="text/css">
		#userRegTable,#editTable
		  {
		  font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
		  width:50%;
		  border-collapse:collapse;
		  }
		
		#userRegTable td,#editTable td, #customers th,#editTable th 
		  {
		  font-size:1em;
		  border:1px solid #98bf21;
		  padding:3px 7px 2px 7px;
		  }
		
		#userRegTable th,#editTable th
		  {
		  font-size:1.1em;
		  text-align:left;
		  padding-top:5px;
		  padding-bottom:4px;
		  background-color:#A7C942;
		  color:#ffffff;
		  }
		
		 .alt
		  {
		  color:#000000;
		  background-color:#EAF2D3;
		  }
	</style>
	<script type="text/javascript">
	$(function(){
		var memberId = "${param.memberId}";
		$.ajax({ 
			type:'post',
			url:"/admin/member/memberView.action?memberId=" + memberId,
			dataType:'json',
			success:function(data){
				var member = data.member;
				$("#memberEname").html(member.memberEname);
				$("#memberCname").html(member.memberCname);
				$("#shortName").html(member.shortName);
				$("#regTime").html(member.regTime);
				$("#str50_1_1").html("入会时间");
				$("#str50_1").html(member.str50_1);
				$("#str50_15_1").html("邮政编码");
				$("#str50_15").html(member.str50_15);
				if(member.memberType == '20'){
					$("#memberType").html("个人");
					$("#str50_2_1").html("证件到期日期");
					$("#str50_3_1").html("出生日期");
					$("#str50_4_1").html("教育情况");
					$("#str50_5_1").html("职业");
					$("#str50_6_1").html("以往投资经验");
					$("#str50_7_1").html("风险承受能力评估机构名称");
					$("#str50_8_1").html("风险承受能力评估结果");
					$("#str50_9_1").html("国籍");
					$("#str50_10_1").html("居住地");
					$("#str50_11_1").html("联系地址");
					$("#str50_12_1").html("紧急联系人");
					$("#str50_13_1").html("紧急联系人电话");
					$("#str50_14_1").html("个人收入情况");
					$("#str50_16_1").html("家庭合计收入情况");
					$("#str50_17_1").html("个人金融净资产情况");
					$("#str50_18_1").html("家庭金融净资产情况");
					$("#tr_50_19").hide();
					$("#tr_100_1").hide();
					$("#tr_100_2").hide();
					$("#tr_100_3").hide();
					$("#tr_100_4").hide();
					$("#tr_100_5").hide();
					$("#tr_100_6").hide();
					$("#tr_max_1").hide();
					$("#tr_max_2").hide();
					$("#str50_2").html(member.str50_2);
					$("#str50_3").html(member.str50_3);
					$("#str50_4").html(member.str50_4);
					$("#str50_5").html(member.str50_5);
					$("#str50_6").html(member.str50_6);
					$("#str50_7").html(member.str50_7);
					$("#str50_8").html(member.str50_8);
					$("#str50_9").html(member.str50_9);
					$("#str50_10").html(member.str50_10);
					$("#str50_11").html(member.str50_11);
					$("#str50_12").html(member.str50_12);
					$("#str50_13").html(member.str50_13);
					$("#str50_14").html(member.str50_14);
					$("#str50_15").html(member.str50_15);
					$("#str50_16").html(member.str50_16);
					$("#str50_17").html(member.str50_17);
					$("#str50_18").html(member.str50_18);
					
					//showPersonDiv();
				}else if(member.memberType == '21') {
						$("#str50_2_1").html("机构中文全称");
						$("#str50_3_1").html("机构英文全称");
						$("#str50_4_1").html("机构简称");
						$("#str50_5_1").html("机构曾用名1");
						$("#str50_6_1").html("机构曾用名2");
						$("#str50_7_1").html("组织机构代码");
						$("#str50_10_1").html("法定代表人");
						$("#str50_11_1").html("成立时间");
						$("#str50_12_1").html("所属行业");
						$("#str50_13_1").html("注册地");
						$("#str50_14_1").html("所属地");
						$("#str50_18_1").html("机构地址");
						$("#str50_19_1").html("机构传真");
						$("#str100_1_1").html("注册资本");
						$("#str100_2_1").html("资产总额");
						$("#str100_3_1").html("营业收入");
						$("#str100_4_1").html("净资产");
						$("#str100_5_1").html("净利润");
						$("#str100_6_1").html("利润总额");
						$("#str50_2").html(member.str50_2);
						$("#str50_3").html(member.str50_3);
						$("#str50_4").html(member.str50_4);
						$("#str50_5").html(member.str50_5);
						$("#str50_6").html(member.str50_6);
						$("#str50_7").html(member.str50_7);
						$("#str50_10").html(member.str50_10);
						$("#str50_11").html(member.str50_11);
						$("#str50_12").html(member.str50_12);
						$("#str50_13").html(member.str50_13);
						$("#str50_14").html(member.str50_14);
						$("#str50_18").html(member.str50_18);
						$("#str50_19").html(member.str50_19);
						$("#str100_1").html(member.str100_1);
						$("#str100_2").html(member.str100_2);
						$("#str100_3").html(member.str100_3);
						$("#str100_4").html(member.str100_4);
						$("#str100_5").html(member.str100_5);
						$("#str100_6").html(member.str100_6);
					if(member.orgType == '0'){
						$("#memberType").html("机构(金融机构)");
						$("#str50_8_1").html("金融许可证编码");
						$("#str50_9_1").html("税务登记证号码");
						//$("#str50_16_1").html("家庭合计收入情况");
						//$("#str50_17_1").html("个人金融净资产情况");
						$("#tr_50_16").hide();
						$("#tr_50_17").hide();
						$("#strmax_1_1").html("备注");
						$("#strmax_2_1").html("其他");
						$("#str50_8").html(member.str50_8);
						$("#str50_9").html(member.str50_9);
						$("#str50_16").html(member.str50_16);
						$("#str50_17").html(member.str50_17);
						$("#strmax_1").html(member.strmax_1);
						$("#strmax_2").html(member.strmax_2);
					}else if(member.orgType == '1'){
						$("#str50_8_1").html("人员总数");
						$("#str50_9_1").html("企业规模");
						$("#str50_16_1").html("股东信息");
						$("#str50_17_1").html("控股比例");
						$("#memberType").html("机构(一般企业)");
						$("#strmax_1_1").html("备注");
						$("#strmax_1").html(member.strmax_1);
						$("#tr_max_2").hide("");
					}else{
						$("#memberType").html("");
					}
				}
				$("#memberRoles").html(member.memberRoles);
				$("#mobile").html(member.mobile);
				$("#phone").html(member.phone);
				$("#email").html(member.email);
				clientManager(member.clientManager);
				//$("#clientManager").html(member.clientManager);
				if(member.memberType == "20"){
					loadCert('personCertType',member.certType);
				}else if(member.memberType == "21"){
					loadCert('orgCertType',member.certType);
				}else{
					
				}
				$("#certNo").html(member.certNo);
				$("#str50_20_1").html("银行结算账户户名（全称）");
				$("#str100_7_1").html("开户银行");
				$("#str100_8_1").html("银行账号");
				$("#str50_20").html(member.str50_20);
				$("#str100_7").html(member.str100_7);
				$("#str100_8").html(member.str100_8);
			},
			error:function(){
				 alert("请检查服务器！");
			}
		}); 
	});
	//根据会员类型，加载证件类型
	function loadCert(memberType,typeValue){
		var memberRoles_url = "${ctx}/member/uct/queryMemberRoles.action?cateName=" + memberType;
		$.ajax({ 
			type:'post',
			url:memberRoles_url,
			dataType:'json',
			success:function(data){
				$("#certType").html("");
				for ( var i = 0; i < data.length; i++) {
					var textAndValue = data[i].split("|");
					var itemValue = textAndValue[0];
					var itemText = textAndValue[1];
					if(itemValue == typeValue){
						$("#certType").html(itemText);
					}else{

					}
	      		};			
			},
			error:function(){
				 alert("请检查服务器！");
			}
		}); 
	}
	function clientManager(key){
		var user_list_url = "${ctx}/member/uct/queryUsersByUType?userType=1";
		//alert(user_list_url);
		$.ajax({ 
			type:'post',
			url:user_list_url,
			dataType:'json',
			success:function(data){
				var users = data;
				for ( var i = 0; i < data.length; i++) {
					var user = users[i];				
					var username = user.userEname;
					var realname = user.userCname;
					if(username == key){
				   	 	$("#"+"clientManager").html(realname);
					}
	      		}			
			},
			error:function(){
				 alert("请检查服务器！");
			}
		});
	}
	function showPersonDiv(){
		 
	}
	</script>
  </head>
  <body>
		<div class="form-group" style="text-align: center;">
			<table id="userRegTable" align="center" border="1px red solid">
				<tr class="">
					<td>
						<label for="memberEname" class="col-sm-2 control-label">会员账号</label>
					</td>
					<td id="memberEname">
					</td>
				</tr>
				<tr>
					<td>
						<label for="memberCname" class="col-sm-2 control-label">会员全称</label>
					</td>
					<td id="memberCname">
					</td>
				</tr>
				<tr class="">
					<td>
						<label for="shortName" class="">会员简称</label>
					</td>
					<td id="shortName">
					</td>
				</tr>
				<tr class="">
					<td>
						<label for="memberType" class="">会员属性</label>
					</td>
					<td id="memberType">
						
					</td>
				</tr>
				<tr>
					<td>
						<label for="memberRoles" class="">会员类型</label>
					</td>
					<td id="memberRoles">
						
					</td>
				</tr>
				<tr class="">
					<td>
						<label for="mobile" class="col-sm-2 control-label">移动电话</label>
					</td>
					<td id="mobile">
					</td>
				</tr>
				<tr>
					<td>
						<label for="phone" class="col-sm-2 control-label">固定电话</label>
					</td>
					<td id="phone">
					</td>
				</tr>
				<tr class="">
					<td>
						<label for="email" class="col-sm-2 control-label">邮箱</label>
					</td>
					<td id="email">
					</td>
				</tr>
				<tr>
					<td>
						<label for="clientManager" class="col-sm-2 control-label">客户经理</label>
					</td>
					<td id="clientManager">
					</td>
				</tr>
				<tr class="">
					<td>
						<label for="certType" class="col-sm-2 control-label">证件类型</label>
					</td>
					<td id="certType">
					</td>
				</tr>
				<tr>
					<td>
						<label for="certNo" class="col-sm-2 control-label">证件号码</label>
					</td>
					<td id="certNo">
					</td>
				</tr>
				<tr>
					<td>
						<label for="regTime" class="col-sm-2 control-label">注册时间</label>
					</td>
					<td id="regTime">
					</td>
				</tr>
				<tr>
					<td id="str50_1_1">
					</td>
					<td id="str50_1">
					</td>
				</tr>
				<tr id="tr_50_2">
					<td id="str50_2_1">
					</td>
					<td id="str50_2">
					</td>
				</tr>
				<tr id="tr_50_3">
					<td id="str50_3_1">
					</td>
					<td id="str50_3">
					</td>
				</tr>
				<tr id="tr_50_4">
					<td id="str50_4_1">
					</td>
					<td id="str50_4">
					</td>
				</tr>
				<tr id="tr_50_5">
					<td id="str50_5_1">
					</td>
					<td id="str50_5">
					</td>
				</tr>
				<tr id="tr_50_6">
					<td id="str50_6_1">
					</td>
					<td id="str50_6">
					</td>
				</tr>
				<tr id="tr_50_7">
					<td id="str50_7_1">
					</td>
					<td id="str50_7">
					</td>
				</tr>
				<tr id="tr_50_8">
					<td id="str50_8_1">
					</td>
					<td id="str50_8">
					</td>
				</tr>
				<tr id="tr_50_9">
					<td id="str50_9_1">
					</td>
					<td id="str50_9">
					</td>
				</tr>
				<tr id="tr_50_10">
					<td id="str50_10_1">
					</td>
					<td id="str50_10">
					</td>
				</tr>
				<tr id="tr_50_11">
					<td id="str50_11_1">
					</td>
					<td id="str50_11">
					</td>
				</tr>
				<tr id="tr_max_1">
					<td id="strmax_1_1">
					</td>
					<td id="strmax_1">
					</td>
				</tr>
				<tr id="tr_50_12">
					<td id="str50_12_1">
					</td>
					<td id="str50_12">
					</td>
				</tr>
				<tr id="tr_50_13">
					<td id="str50_13_1">
					</td>
					<td id="str50_13">
					</td>
				</tr>
				<tr id="tr_50_14">
					<td id="str50_14_1">
					</td>
					<td id="str50_14">
					</td>
				</tr>
				<tr id="tr_50_15">
					<td id="str50_15_1">
					</td>
					<td id="str50_15">
					</td>
				</tr>
				<tr id="tr_50_16">
					<td id="str50_16_1">
					</td>
					<td id="str50_16">
					</td>
				</tr>
				<tr id="tr_50_17">
					<td id="str50_17_1">
					</td>
					<td id="str50_17">
					</td>
				</tr>
				<tr id="tr_50_18">
					<td id="str50_18_1">
					</td>
					<td id="str50_18">
					</td>
				</tr>
				<tr id="tr_50_19">
					<td id="str50_19_1">
					</td>
					<td id="str50_19">
					</td>
				</tr>
				
				<tr id="tr_100_1">
					<td id="str100_1_1">
					</td>
					<td id="str100_1">
					</td>
				</tr>
				<tr id="tr_100_2">
					<td id="str100_2_1">
					</td>
					<td id="str100_2">
					</td>
				</tr>
				<tr id="tr_100_3">
					<td id="str100_3_1">
					</td>
					<td id="str100_3">
					</td>
				</tr>
				<tr id="tr_100_4">
					<td id="str100_4_1">
					</td>
					<td id="str100_4">
					</td>
				</tr>
				<tr id="tr_100_5">
					<td id="str100_5_1">
					</td>
					<td id="str100_5">
					</td>
				</tr>
				<tr id="tr_100_6">
					<td id="str100_6_1">
					</td>
					<td id="str100_6">
					</td>
				</tr>
				<tr id="tr_50_20">
					<td id="str50_20_1">
					</td>
					<td id="str50_20">
					</td>
				</tr>
				<tr id="tr_100_7">
					<td id="str100_7_1">
					</td>
					<td id="str100_7">
					</td>
				</tr>
				<tr id="tr_100_8">
					<td id="str100_8_1">
					</td>
					<td id="str100_8">
					</td>
				</tr>
				<tr id="tr_max_2">
					<td id="strmax_2_1">
					</td>
					<td id="strmax_2">
					</td>
				</tr>
			</table>
	</div>			
  </body>
</html>
